FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/golang:1.23.1

# 工作目录
WORKDIR /ESAlert

COPY go.mod go.sum ./
COPY ./app ./app
COPY ./config.ini ./
COPY ./rule ./rule

# 构建
RUN GOPROXY="https://goproxy.cn" CGO_ENABLED=0 GOOS=linux go build -o ESAlert ./app

EXPOSE 9095

CMD ["./ESAlert","--config","/ESAlert/config.ini"]